/*
 * Copyright 2013 Agustina Martinez-Garcia

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package uk.ljmu.metadata.staticschemas;

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.Property;
import com.hp.hpl.jena.rdf.model.Resource;

public class DoapSchema {
	  /** <p>The RDF model that holds the vocabulary terms</p> */
    private static Model m_model = ModelFactory.createDefaultModel();
    
    /** <p>The namespace of the vocabulary as a string</p> */
    public static final String NS = "http://usefulinc.com/ns/doap#";
    
    /** <p>The namespace of the vocabulary as a string</p>
     *  @see #NS */
    public static String getURI() {return NS;}
    
    /** <p>The namespace of the vocabulary as a resource</p> */
    public static final Resource NAMESPACE = m_model.createResource( NS );
    
    /** <p>�lo?i?t? pro anonymn� p?�stup.Repositorio para acceso an�nimo.????????????Repository 
     *  f�r anonymen ZugriffRepository for anonymous access.D�p�t pour acc�s anonyme.</p>
     */
    public static final Property anon_root = m_model.createProperty( "http://usefulinc.com/ns/doap#anon-root" );
    
    /** <p>Description of target user base????????????</p> */
    public static final Property audience = m_model.createProperty( "http://usefulinc.com/ns/doap#audience" );
    
    /** <p>????????????????URIURI of a blog related to a project</p> */
    public static final Property blog = m_model.createProperty( "http://usefulinc.com/ns/doap#blog" );
    
    /** <p>Web-Browser Interface f�r das Repository.??????????????????????????Interface 
     *  web del repositorio.Webov� rozhran� pro prohl�?en� �lo?i?t?.Web browser interface 
     *  to repository.Interface web au d�p�t.</p>
     */
    public static final Property browse = m_model.createProperty( "http://usefulinc.com/ns/doap#browse" );
    
    /** <p>Spr�va chyb projektu.Fehlerdatenbank eines Projektes.Bug tracker para un proyecto.???????????????Suivi 
     *  des bugs pour un projet.Bug tracker for a project.</p>
     */
    public static final Property bug_database = m_model.createProperty( "http://usefulinc.com/ns/doap#bug-database" );
    
    /** <p>Une cat�gorie de projet.A category of project.Kategorie projektu.Eine Kategorie 
     *  eines Projektes.Una categor�a de proyecto.????????????</p>
     */
    public static final Property category = m_model.createProperty( "http://usefulinc.com/ns/doap#category" );
    
    /** <p>Datum, kdy bylo n?co vytvo?eno ve form�tu RRRR-MM-DD, nap?. 2004-04-05Fecha 
     *  en la que algo fue creado, en formato AAAA-MM-DD. e.g. 2004-04-05Date when 
     *  something was created, in YYYY-MM-DD form. e.g. 2004-04-05???????????AAAA-MM-JJ??????2004-04-05?Erstellungsdatum 
     *  von Irgendwas, angegeben im YYYY-MM-DD Format, z.B. 2004-04-05.Date � laquelle 
     *  a �t� cr�� quelque chose, au format AAAA-MM-JJ (par ex. 2004-04-05)</p>
     */
    public static final Property created = m_model.createProperty( "http://usefulinc.com/ns/doap#created" );
    
    /** <p>Descripci�n en texto plano de un proyecto, de 2 a 4 enunciados de longitud.Plain 
     *  text description of a project, of 2-4 sentences in length.Beschreibung eines 
     *  Projekts als einfacher Text mit der L�nge von 2 bis 4 S�tzen.Texte descriptif 
     *  d'un projet, long de 2 � 4 phrases.????????????2??4???????ist? textov?, 2 
     *  a? 4 v?ty dlouh? popis projektu.</p>
     */
    public static final Property description = m_model.createProperty( "http://usefulinc.com/ns/doap#description" );
    
    /** <p>D�veloppeur pour le projet.Software-Entwickler f�r eine Projekt.Developer 
     *  of software for the project.V?voj�? softwaru projektu.Desarrollador de software 
     *  para el proyecto.?????????????????</p>
     */
    public static final Property developer = m_model.createProperty( "http://usefulinc.com/ns/doap#developer" );
    
    /** <p>Spoluautor dokumentace projektu.Contributor of documentation to the project.Collaborateur 
     *  � la documentation du projet.???????????????????Mitarbeiter an der Dokumentation 
     *  eines Projektes.Proveedor de documentaci�n para el proyecto.</p>
     */
    public static final Property documenter = m_model.createProperty( "http://usefulinc.com/ns/doap#documenter" );
    
    /** <p>Mirror of software download web page.Mirror de la p�gina web de descarga.Spiegel 
     *  der Seite von die Projekt-Software heruntergeladen werden kann.Zrcadlo str�nky 
     *  pro sta?en� softwaru.Miroir de la page de t�l�chargement du programme.??????????????????</p>
     */
    public static final Property download_mirror = m_model.createProperty( "http://usefulinc.com/ns/doap#download-mirror" );
    
    /** <p>Page web � partir de laquelle on peut t�l�charger le programme.Web page from 
     *  which the project software can be downloaded.Webov� str�nka, na kter� lze 
     *  st�hnout projektov? software.P�gina web de la cu�l se puede bajar el software.????????????????????????Web-Seite 
     *  von der die Projekt-Software heruntergeladen werden kann.</p>
     */
    public static final Property download_page = m_model.createProperty( "http://usefulinc.com/ns/doap#download-page" );
    
    /** <p>URI adresa sta?en� asociovan� s reviz�.URI of download associated with this 
     *  release.</p>
     */
    public static final Property file_release = m_model.createProperty( "http://usefulinc.com/ns/doap#file-release" );
    
    /** <p>????????????Spoluautor projektu.Project contributor.Colaborador del proyecto.Collaborateur 
     *  au projet.Projekt-Mitarbeiter.</p>
     */
    public static final Property helper = m_model.createProperty( "http://usefulinc.com/ns/doap#helper" );
    
    /** <p>URL of a project's homepage, associated with exactly one project.????????????????URL????????????????????????????????L'URL 
     *  de la page web d'un projet, associ�e avec un unique projet.El URL de la p�gina 
     *  de un proyecto, asociada con exactamente un proyecto.URL der Projekt-Homepage, 
     *  verbunden mit genau einem Projekt.URL adresa domovsk� str�nky projektu asociovan� 
     *  s pr�v? jedn�m projektem.</p>
     */
    public static final Property homepage = m_model.createProperty( "http://usefulinc.com/ns/doap#homepage" );
    
    /** <p>?????????????????????????API???????????A specification that a project implements. 
     *  Could be a standard, API or legally defined level of conformance.</p>
     */
    public static final Property implements_ = m_model.createProperty( "http://usefulinc.com/ns/doap#implements" );
    
    /** <p>?????????????????ISO?????ISO language code a project has been translated into</p> */
    public static final Property language = m_model.createProperty( "http://usefulinc.com/ns/doap#language" );
    
    /** <p>?????????????????RDF???URIThe URI of an RDF description of the license the 
     *  software is distributed under.El URI de una descripci�n RDF de la licencia 
     *  bajo la cu�l se distribuye el software.Die URI einer RDF-Beschreibung einer 
     *  Lizenz unter der die Software herausgegeben wird.L'URI d'une description RDF 
     *  de la licence sous laquelle le programme est distribu�.URI adresa RDF popisu 
     *  licence, pod kterou je software distribuov�n.</p>
     */
    public static final Property license = m_model.createProperty( "http://usefulinc.com/ns/doap#license" );
    
    /** <p>Emplacement d'un d�p�t.Lokation eines Repositorys.???????????Um�st?n� �lo?i?t?.lugar 
     *  de un repositorio.Location of a repository.</p>
     */
    public static final Property location = m_model.createProperty( "http://usefulinc.com/ns/doap#location" );
    
    /** <p>Mailing list home page or email address.Domovsk� str�nka nebo e�mailov� adresa 
     *  e�mailov� diskuse.Homepage der Mailing Liste oder E-Mail Adresse.P�gina web 
     *  de la lista de correo o direcci�n de correo.???????????????????????Page web 
     *  de la liste de diffusion, ou adresse de courriel.</p>
     */
    public static final Property mailing_list = m_model.createProperty( "http://usefulinc.com/ns/doap#mailing-list" );
    
    /** <p>Hauptentwickler eines Projektes, der ProjektleiterDesarrollador principal 
     *  de un proyecto, un l�der de proyecto.Maintainer of a project, a project leader.Spr�vce 
     *  projektu, vedouc� projektu.D�veloppeur principal d'un projet, un meneur du 
     *  projet.????????????????????</p>
     */
    public static final Property maintainer = m_model.createProperty( "http://usefulinc.com/ns/doap#maintainer" );
    
    /** <p>Jm�no modulu v �lo?i?ti.Module name of a repository.Nombre del m�dulo de un 
     *  repositorio.???????????????Nom du module d'un d�p�t.Modul-Name eines Subversion.</p>
     */
    public static final Property module = m_model.createProperty( "http://usefulinc.com/ns/doap#module" );
    
    /** <p>El nombre de algo.?????Der Name von IrgendwasJm�no n??eho.Le nom de quelque 
     *  chose.A name of something.</p>
     */
    public static final Property name = m_model.createProperty( "http://usefulinc.com/ns/doap#name" );
    
    /** <p>URL der letzten Projekt-Homepage, verbunden mit genau einem Projekt.URL adresa 
     *  p?ede?l� domovsk� str�nky projektu asociovan� s pr�v? jedn�m projektem.??????????????????????????????????????????URL 
     *  of a project's past homepage, associated with exactly one project.L'URL d'une 
     *  ancienne page web d'un projet, associ�e avec un unique projet.El URL de la 
     *  antigua p�gina de un proyecto, asociada con exactamente un proyecto.</p>
     */
    public static final Property old_homepage = m_model.createProperty( "http://usefulinc.com/ns/doap#old-homepage" );
    
    /** <p>Operating system that a project is limited to. Omit this property if the project 
     *  is not OS-specific.Opera?n� syst�m, na jeho? pou?it� je projekt limitov�n. 
     *  Vynechejte tuto vlastnost, pokud je projekt nez�visl? na opera?n�m syst�mu.??????????????????????????????????????OS????????????????????????Sistema 
     *  opertivo al cu�l est� limitado el proyecto. Omita esta propiedad si el proyecto 
     *  no es espec�fico de un sistema opertaivo en particular.Syst�me d'exploitation 
     *  auquel est limit� le projet. Omettez cette propri�t� si le projet n'est pas 
     *  limit� � un syst�me d'exploitation.Betriebssystem auf dem das Projekt eingesetzt 
     *  werden kann. Diese Eigenschaft kann ausgelassen werden, wenn das Projekt nicht 
     *  BS-spezifisch ist.</p>
     */
    public static final Property os = m_model.createProperty( "http://usefulinc.com/ns/doap#os" );
    
    /** <p>?????????????????????OS???????????Java?Firefox?ECMA CLR???Indicator of software 
     *  platform (non-OS specific), e.g. Java, Firefox, ECMA CLR</p>
     */
    public static final Property platform = m_model.createProperty( "http://usefulinc.com/ns/doap#platform" );
    
    /** <p>Langage de programmation avec lequel un projet est impl�ment�, ou avec lequel 
     *  il est pr�vu de l'utiliser.Programming language a project is implemented in 
     *  or intended for use with.?????????????????????????????????Programmiersprache 
     *  in der ein Projekt implementiert ist oder intendiert wird zu benutzen.Programovac� 
     *  jazyk, ve kter�m je projekt implementov�n nebo pro kter? je zam??len k pou?it�.Lenguaje 
     *  de programaci�n en el que un proyecto es implementado o con el cu�l pretende 
     *  usarse.</p>
     */
    public static final Property programming_language = m_model.createProperty( "http://usefulinc.com/ns/doap#programming-language" );
    
    /** <p>Un release (versi�n) de un proyecto.Une release (r�vision) d'un projet.?????????????Relase 
     *  (verze) projektu.Ein Release (Version) eines Projekts.A project release.</p>
     */
    public static final Property release = m_model.createProperty( "http://usefulinc.com/ns/doap#release" );
    
    /** <p>?????????????????????Quellcode-Versionierungssystem.�lo?i?t? zdrojov?ch k�d?.Repositorio 
     *  del c�digo fuente.Source code repository.D�p�t du code source.</p>
     */
    public static final Property repository = m_model.createProperty( "http://usefulinc.com/ns/doap#repository" );
    
    /** <p>Identifiant de r�vision d'une release du programme.Identifik�tor zp?�stupn?n� 
     *  revize softwaru.Indentificador de la versi�n de un release de software.Revision 
     *  identifier of a software release.???????????????Versionsidentifikator eines 
     *  Software-Releases.</p>
     */
    public static final Property revision = m_model.createProperty( "http://usefulinc.com/ns/doap#revision" );
    
    /** <p>P�gina web con capturas de pantalla del proyecto.Webov� str�nka projektu se 
     *  sn�mky obrazovky.Web-Seite mit Screenshots eines Projektes.Web page with screenshots 
     *  of project.Page web avec des captures d'�cran du projet.??????????????????</p>
     */
    public static final Property screenshots = m_model.createProperty( "http://usefulinc.com/ns/doap#screenshots" );
    
    /** <p>?????????????????????????The URI of a web service endpoint where software 
     *  as a service may be accessed</p>
     */
    public static final Property service_endpoint = m_model.createProperty( "http://usefulinc.com/ns/doap#service-endpoint" );
    
    /** <p>Kr�tk? (8 nebo 9 slov) ?ist? textov? popis projektu.??????????????Descripci�n 
     *  corta (8 o 9 palabras) en texto plano de un proyecto.Short (8 or 9 words) 
     *  plain text description of a project.Texte descriptif concis (8 ou 9 mots) 
     *  d'un projet.Kurzbeschreibung (8 oder 9 W�rter) eines Projects als einfacher 
     *  Text.</p>
     */
    public static final Property shortdesc = m_model.createProperty( "http://usefulinc.com/ns/doap#shortdesc" );
    
    /** <p>A tester or other quality control contributor.Ein Tester oder anderer Mitarbeiter 
     *  der Qualit�tskontrolle.Un testeur ou un collaborateur au contr�le qualit�.Tester 
     *  nebo jin? spoluautor kontroluj�c� kvalitu.Un tester u otro proveedor de control 
     *  de calidad.???????????????????????????</p>
     */
    public static final Property tester = m_model.createProperty( "http://usefulinc.com/ns/doap#tester" );
    
    /** <p>Proveedor de traducciones al proyecto.Spoluautor p?ekladu projektu.Collaborateur 
     *  � la traduction du projet.Contributor of translations to the project.Mitarbeiter 
     *  an den �bersetzungen eines Projektes.????????????????</p>
     */
    public static final Property translator = m_model.createProperty( "http://usefulinc.com/ns/doap#translator" );
    
    /** <p>Vendor organization: commercial, free or otherwise?????????????????</p> */
    public static final Property vendor = m_model.createProperty( "http://usefulinc.com/ns/doap#vendor" );
    
    /** <p>URL del Wiki para discusi�n colaborativa del proyecto.L'URL du Wiki pour la 
     *  discussion collaborative sur le projet.URL of Wiki for collaborative discussion 
     *  of project.URL adresa wiki projektu pro spole?n� diskuse.Wiki-URL f�r die 
     *  kollaborative Dikussion eines Projektes.???????????????</p>
     */
    public static final Property wiki = m_model.createProperty( "http://usefulinc.com/ns/doap#wiki" );
    
    /** <p>Repositorio GNU Arch del c�digo fuente.GNU Arch source code repository.D�p�t 
     *  GNU Arch du code source.???????GNU Arch??????�lo?i?t? zdrojov?ch k�d? GNU 
     *  Arch.GNU Arch Quellcode-Versionierungssystem.</p>
     */
    public static final Resource ArchRepository = m_model.createResource( "http://usefulinc.com/ns/doap#ArchRepository" );
    
    /** <p>???????BitKeeper??????Repositorio BitKeeper del c�digo fuente.D�p�t BitKeeper 
     *  du code source.BitKeeper Quellcode-Versionierungssystem.BitKeeper source code 
     *  repository.�lo?i?t? zdrojov?ch k�d? BitKeeper.</p>
     */
    public static final Resource BKRepository = m_model.createResource( "http://usefulinc.com/ns/doap#BKRepository" );
    
    /** <p>CVS Quellcode-Versionierungssystem.???????CVS??????CVS source code repository.Repositorio 
     *  CVS del c�digo fuente.�lo?i?t? zdrojov?ch k�d? CVS.D�p�t CVS du code source.</p>
     */
    public static final Resource CVSRepository = m_model.createResource( "http://usefulinc.com/ns/doap#CVSRepository" );
    
    public static Model getModel()
    {
    	Model myModel = ModelFactory.createDefaultModel();
    	myModel.createResource( NS );
    	myModel.createProperty( NS, "CVSRepository" );
    	myModel.createProperty( NS, "BKRepository" );
    	myModel.createProperty( NS, "ArchRepository" );
    	myModel.createProperty( NS, "wiki" );
    	myModel.createProperty( NS, "description" );
    	myModel.createProperty( NS, "anon-root" );
    	myModel.createProperty( NS, "audience" );
    	myModel.createProperty( NS, "blog" );
    	myModel.createProperty( NS, "browse" );
    	myModel.createProperty( NS, "bug-database" );
    	myModel.createProperty( NS, "category" );
    	myModel.createProperty( NS, "created" );
    	myModel.createProperty( NS, "developer" );
    	myModel.createProperty( NS, "documenter" );
    	myModel.createProperty( NS, "download-mirror" );
    	myModel.createProperty( NS, "download-page" );
    	myModel.createProperty( NS, "file-release" );
    	myModel.createProperty( NS, "helper" );
    	myModel.createProperty( NS, "homepage" );
    	myModel.createProperty( NS, "implements" );
    	myModel.createProperty( NS, "language" );
    	myModel.createProperty( NS, "license" );
    	myModel.createProperty( NS, "location" );
    	myModel.createProperty( NS, "maintainer" );
    	myModel.createProperty( NS, "mailing-list" );
    	myModel.createProperty( NS, "module" );
    	myModel.createProperty( NS, "name" );
    	myModel.createProperty( NS, "old-homepage" );
    	myModel.createProperty( NS, "os" );
    	myModel.createProperty( NS, "platform" );
    	myModel.createProperty( NS, "programming-language" );
    	myModel.createProperty( NS, "release" );
    	myModel.createProperty( NS, "repository" );
    	myModel.createProperty( NS, "revision" );
    	myModel.createProperty( NS, "screenshots" );
    	myModel.createProperty( NS, "service-endpoint" );
    	myModel.createProperty( NS, "shortdesc" );
    	myModel.createProperty( NS, "tester" );
    	myModel.createProperty( NS, "translator" );
    	myModel.createProperty( NS, "vendor" );
        
    	return myModel;
    }
    
    public static boolean containsProperty(String elementName)
    {
    	if (elementName.contains(":"))
    		elementName = elementName.substring(elementName.indexOf(":") + 1);
    	
    	if (!DoapSchema.audience.getLocalName().equals(elementName) &&
    			!DoapSchema.audience.getLocalName().equals(elementName) &&
    			!DoapSchema.blog.getLocalName().equals(elementName) &&
    			!DoapSchema.browse.getLocalName().equals(elementName) &&
    			!DoapSchema.bug_database.getLocalName().equals(elementName) &&
    			!DoapSchema.category.getLocalName().equals(elementName) &&
    			!DoapSchema.created.getLocalName().equals(elementName) &&
    			!DoapSchema.description.getLocalName().equals(elementName) &&
    			!DoapSchema.developer.getLocalName().equals(elementName) &&
    			!DoapSchema.documenter.getLocalName().equals(elementName) &&
    			!DoapSchema.download_mirror.getLocalName().equals(elementName) &&
    			!DoapSchema.download_page.getLocalName().equals(elementName) &&
    			!DoapSchema.file_release.getLocalName().equals(elementName) &&
    			!DoapSchema.helper.getLocalName().equals(elementName) &&
    			!DoapSchema.homepage.getLocalName().equals(elementName) &&
    			!DoapSchema.language.getLocalName().equals(elementName) &&
    			!DoapSchema.license.getLocalName().equals(elementName) &&
    			!DoapSchema.location.getLocalName().equals(elementName) &&
    			!DoapSchema.mailing_list.getLocalName().equals(elementName) &&
    			!DoapSchema.maintainer.getLocalName().equals(elementName) &&
    			!DoapSchema.module.getLocalName().equals(elementName) &&
    			!DoapSchema.name.getLocalName().equals(elementName) &&
    			!DoapSchema.old_homepage.getLocalName().equals(elementName) &&
    			!DoapSchema.os.getLocalName().equals(elementName) &&
    			!DoapSchema.platform.getLocalName().equals(elementName) &&
    			!DoapSchema.programming_language.getLocalName().equals(elementName) &&
    			!DoapSchema.release.getLocalName().equals(elementName) &&
    			!DoapSchema.repository.getLocalName().equals(elementName) &&
    			!DoapSchema.revision.getLocalName().equals(elementName) &&
    			!DoapSchema.screenshots.getLocalName().equals(elementName) &&
    			!DoapSchema.service_endpoint.getLocalName().equals(elementName) &&
    			!DoapSchema.shortdesc.getLocalName().equals(elementName) &&
    			!DoapSchema.tester.getLocalName().equals(elementName) &&
    			!DoapSchema.translator.getLocalName().equals(elementName) &&
    			!DoapSchema.vendor.getLocalName().equals(elementName) &&
    			!DoapSchema.wiki.getLocalName().equals(elementName))
    	return false;
    	else return true;
    }
    
    public static boolean containsResource(String elementName)
    {
    	if (elementName.contains(":"))
    		elementName = elementName.substring(elementName.indexOf(":") + 1);
    	
    	if (!DoapSchema.ArchRepository.getLocalName().equals(elementName) &&
    			!DoapSchema.BKRepository.getLocalName().equals(elementName) &&
    			!DoapSchema.CVSRepository.getLocalName().equals(elementName))
    	return false;
    	else return true;
    }
}
